<%--
  Created by IntelliJ IDEA.
  User: miao
  Date: 2022/11/10
  Time: 18:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
  <head>
    <title>展示反馈信息界面</title>
    <link rel="stylesheet" type="text/css" href="css/page.css">
  </head>
  <body>
    <table border="1px">
      <caption>反馈信息页</caption>
      <thead>
        <tr>
          <th>自增主键</th>
          <th>用户id</th>
          <th>用户名称</th>
          <th>信息简要</th>
          <th colspan="2">操作</th>
        </tr>
      </thead>
      <tbody>
      <c:forEach items="${adviseInfoPage.list}" var="adviseInfo">
        <tr>
          <td>${adviseInfo.adviseId}</td>
          <td>${adviseInfo.userId}</td>
          <td>${adviseInfo.userName}</td>
          <td>${adviseInfo.adviseContent.length() > 10 ? adviseInfo.adviseContent.substring(0, 10) += "..." : adviseInfo.adviseContent}</td>
          <td><a href="ShowDetailedAdviseServlet?adviseId=${adviseInfo.adviseId}">查看</a></td>
          <td><a href="DeleteAdviseServlet?adviseId=${adviseInfo.adviseId}">删除</a></td>
        </tr>
      </c:forEach>
      </tbody>
      <tfoot>
      <div class="page">
        <a href="ShowAdviseServlet">首页</a>
        <a href="ShowAdviseServlet?num=${adviseInfoPage.prePageNum}">上一页</a>
        <a href="ShowAdviseServlet?num=${adviseInfoPage.nextPageNum}">下一页</a>
        <a href="ShowAdviseServlet?num=${adviseInfoPage.totalPageNum}">末页</a>
        <select id="pageSelect" name="pageSelect" onchange="changePage(this.value)">
          <c:forEach var="i" begin="1" end="${adviseInfoPage.totalPageNum}">
            <c:if test="${i == adviseInfoPage.currentPageNum }">
              <option value="${i }" selected="selected">第${i }页</option>
            </c:if>
            <c:if test="${i != adviseInfoPage.currentPageNum }">
              <option value="${i }">第${i }页</option>
            </c:if>
          </c:forEach>
        </select>
      </div>
      </tfoot>

      <script type="text/javascript">
        function changePage(page){
          window.location.href="ShowAdviseServlet?num=" + page;
        }
      </script>
    </table>
  </body>
</html>






















